package member.controller;

import java.sql.SQLException;

import library.domain.Member;
import member.service.MemberService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class MemberController {
	
	@Autowired
	private MemberService service;
	
	@RequestMapping("/member/join_form.yes")
	public String joinForm(){
		return "/member/join.jsp";
	}
	
	@RequestMapping("/member/join.yes")
	public String join(String memberId, String memberPassword, String memberName) throws SQLException{
		Member m = new Member(memberId, memberPassword, memberName, "111111", "1111111", "01099999999", "경기도");
		service.insertMember(m);
		return "/member/join_success.jsp";
	}
}
